Skip to content

fix(map): keep compass icon visible while following bearing#5728

Merged
jamesarich merged 1 commit into
mainfrom
fix/map-compass-hidden-while-following
Jun 3, 2026
Merged

fix(map): keep compass icon visible while following bearing#5728
jamesarich merged 1 commit into
mainfrom
fix/map-compass-hidden-while-following

Conversation

@jamesarich
Copy link
Copy Markdown
Collaborator

Problem

The compass button on the Mesh Map disappears whenever the map is following the phone's bearing.

Root cause

CompassButton (in MapControlsOverlay.kt) tinted the icon MaterialTheme.colorScheme.primary while following. But MapButton renders a FilledIconButton, whose container is also colorScheme.primary — so the icon was painted the same green as its own background and vanished. Because isFollowing is the first branch in the when, this happened for any bearing.

This is theme-robust to reason about: the app defaults to dynamicColor = true, so primary is device-dependent, but the icon and its container were always the same role, hence always invisible.

Fix

Tint the following-state icon StatusColors.StatusBlue instead — a fixed indigo that stays legible on the primary-colored button and matches the existing pattern (the bearing == 0f branch already uses fixed StatusRed).

val iconTint =
    when {
        isFollowing -> MaterialTheme.colorScheme.StatusBlue
        bearing == 0f -> MaterialTheme.colorScheme.StatusRed
        else -> null
    }

Testing

  • ./gradlew :feature:map:allTests :feature:map:detekt spotlessCheck — pass (23 tests, no detekt/spotless violations).
  • Not yet device-verified visually; worth a quick look in both light and dark themes.

🤖 Generated with Claude Code

CompassButton tinted its icon `colorScheme.primary` while following the phone bearing, but FilledIconButton's container is also `primary` — so the icon was painted the same color as its own background and disappeared. Tint it `StatusBlue` instead (consistent with the existing `StatusRed` north indicator), which stays legible on the primary-colored button.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the bugfix PR tag label Jun 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

📄 Docs staleness check — advisory

This PR modifies user-facing UI source files but does not update any page under docs/en/user/ or docs/en/developer/.

⚠️ Doc changes propagate to 3 consumers: in-app docs browser, Jekyll site (GitHub Pages), and meshtastic.org (Docusaurus sync). Updating a page in docs/en/ automatically flows to all three.

Changed source files:

feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/MapControlsOverlay.kt

What to check:

Changed area Likely doc page
feature/messaging/ docs/en/user/messages-and-channels.md
feature/node/ docs/en/user/nodes.md or docs/en/user/node-metrics.md
feature/map/ docs/en/user/map-and-waypoints.md
feature/connections/ docs/en/user/connections.md
feature/settings/ docs/en/user/settings-radio-user.md or docs/en/user/settings-module-admin.md
feature/firmware/ docs/en/user/firmware.md
feature/intro/ docs/en/user/onboarding.md
feature/discovery/ docs/en/user/discovery.md
feature/docs/ Internal docs infrastructure
core/ui/ docs/en/developer/codebase.md or component-specific user pages

New page checklist (if adding a new doc page):

  1. Create the .md file in docs/en/user/ or docs/en/developer/ with last_updated frontmatter
  2. Register in DocBundleLoader.kt with string resources (in-app browser)
  3. Jekyll and Docusaurus sync pick up new pages automatically — no config change needed

If this PR does not require a doc update (e.g., internal refactor, bug fix, test change), add the skip-docs-check label to dismiss this check.

Cross-platform note: This check is advisory while doc coverage matures. Both Android and Apple repos use the same skip-docs-check label and advisory severity. See meshtastic/design standards for shared conventions.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🖼️ Preview staleness check — advisory

This PR modifies UI composables but does not update any *Previews.kt files.

Previews power screenshot tests and in-app docs screenshots. Keeping them current ensures visual regression coverage stays accurate.

Changed UI files:

feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/MapControlsOverlay.kt

What to check:

Pattern Preview file convention
feature/{name}/…/ui/ or component/ feature/{name}/…/*Previews.kt
core/ui/…/ core/ui/…/ (previews colocated)

Adding previews checklist:

  1. Create or update a *Previews.kt file in the same module with @PreviewLightDark
  2. Add @Suppress("PreviewPublic") if the preview is consumed by screenshot-tests
  3. Add corresponding @PreviewTest function in screenshot-tests/src/screenshotTest/
  4. Run ./gradlew :screenshot-tests:updateDebugScreenshotTest to generate reference images

If this PR does not require preview updates (e.g., logic-only change, non-visual refactor), add the skip-preview-check label to dismiss.

@jamesarich jamesarich enabled auto-merge June 3, 2026 16:41
@jamesarich jamesarich added this pull request to the merge queue Jun 3, 2026
Merged via the queue into main with commit 9bf188c Jun 3, 2026
18 checks passed
@jamesarich jamesarich deleted the fix/map-compass-hidden-while-following branch June 3, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant